// 1.导入创建路由工厂函数
// createWebHashHistory：使用hash模式切换路由
// createWebHistory：使用history模式切换路由
import {createRouter, createWebHashHistory} from "vue-router";
let routes=[
    {
        path:"/",
        redirect:"/home"
    },
    {
        path:"/home",
        component:()=>import("@/views/home")
    },
    {
        path:"/setup",
        component:()=>import("@/views/setup")
    },
    {
        path:"/ref",
        component:()=>import("@/views/ref")
    },
    {
        path:"/reactive",
        component:()=>import("@/views/reactive")
    },
    {
        path:"/toref",
        component:()=>import("@/views/toRef")
    },
    {
        path:"/shallowRef",
        component:()=>import("@/views/shallowRef")
    },
    {
        path:"/watch",
        component:()=>import("@/views/watch")
    },
    {
        path:"/computed",
        component:()=>import("@/views/computed")
    },
    {
        path:"/life",
        component:()=>import("@/views/life")
    },
    {
        path:"/fatherChild",
        component:()=>import("@/views/fatherChild")
    },
    {
        path:"/childFather",
        component:()=>import("@/views/childFather")
    },
    {
        path:"/hooks",
        component:()=>import("@/views/hooks")
    },
    {
        path:"/shop",
        component:()=>import("@/views/shop")
    },
]

// 2.创建路由
const router=createRouter({
    history:createWebHashHistory(),
    routes
})

// 3.导出路由
export default router;